--- ltmain-release-2-1b.in	2009-06-22 15:33:26.000000000 +0200
+++ ltmain-release-2-1b.in.new	2009-07-15 16:59:45.000000000 +0200
@@ -4946,7 +4946,14 @@
 		  fi
 		  ;;
 		*)
-		  path="-L$absdir/$objdir"
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  eval library_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  for library_name in ${library_names}; do :; done
+		  if test $mode = relink && test -f "${inst_prefix_dir}${libdir}/${library_name}"; then
+		     path="-L${inst_prefix_dir}${libdir}"
+		  else
+		    path="-L$absdir/$objdir"
+		  fi
 		  ;;
 		esac
 		else
